<template>
  <div>
    <div class="nav">
      <van-tabs v-model="active">
        <van-tab title="关注">
          <div class="guanzhu" v-for="item in list">
            <div class="g-top">
              <img :src="item.pimg" style="width:60px;height:60px;border-radius:50%;">
              <p>
                <span>{{item.name}}</span>
                <span>{{item.time}}</span>
              </p>
            </div>
            <div class="info">
              <p>【最低配置的厨房应该有哪些调味料和厨具】</p>
              <p>基本厨具:</p>
              <p>{{item.pp}}</p>
            </div>
            <div class="icon">
              <span>
                <van-icon size="30px" name="eye-o"/>2.1万
              </span>
              <span>
                <van-icon size="30px" name="eye-o"/>8000
              </span>
              <span>
                <van-icon size="30px" name="eye-o"/>12000
              </span>
            </div>
          </div>
        </van-tab>
        <van-tab title="发现">
          <div class="top">
            <p class="tucao">一起来吐槽<span>11.11</span></p>
            <p class="buy">买了就后悔的那些东西</p>
          </div>
          <div class="huodong">
            <p>
              <van-tag type="danger" plain>置顶</van-tag>
              【有奖活动】那些买了就后悔的东西
            </p>
          </div>
          <div class="dongtai" v-for="item in list">
            <div class="d-top">
              <div class="d-top-left">
                <img :src="item.pimg" style="width:60px;height:60px;border-radius:50%;">
                <p>
                  <span>{{item.name}}</span>
                  <span>{{item.time}}</span>
                </p>
              </div>
              <div class="d-top-left">
                <van-tag plain type="danger">+关注</van-tag>
              </div>
            </div>
            <div class="d-content">
              <h2 class="d-title">【猫宁】做一份喜欢的早餐迎接周末的到来</h2>
              <div class="imgages">
                <div class="img">
                  <img :src="item.img">
                  <span>
                    <van-icon size="30px" name="eye-o"/>1222
                  </span>

                </div>
                <div class="img">
                  <img :src="item.img">
                  <span>
                    <van-icon size="30px" name="chat-o"/>50
                  </span>
                </div>
                <div class="img">
                  <img :src="item.img">
                  <span>
                    <van-icon size="30px" name="like-o"/>522
                  </span>
                </div>
              </div>
            </div>
          </div>
        </van-tab>
        <van-tab title="最新">
          <div class="new">
            <div class="biaoti">
              <van-row type="flex" justify="space-around">
                <van-col span="0">秀美食</van-col>
                <van-col span="0">烘焙</van-col>
                <van-col span="0">出去吃</van-col>
              </van-row>
              <van-row type="flex" justify="space-around">
                <van-col span="0">厨艺交流</van-col>
                <van-col span="0">聊家常</van-col>
                <van-col span="0">厨房问答</van-col>
              </van-row>
            </div>
            <div class="dongtai" v-for="item in list">
              <div class="d-top">
                <div class="d-top-left">
                  <img :src="item.pimg" style="width:60px;height:60px;border-radius:50%;">
                  <p>
                    <span>{{item.name}}</span>
                    <span>{{item.time}}</span>
                  </p>
                </div>
                <div class="d-top-left">
                  <van-tag plain type="danger">+关注</van-tag>
                </div>
              </div>
              <div class="d-content">
                <h2 class="d-title">【下午茶】利用下午休闲时间做了几个小面包，请忽
                  略我的烤盘，哈哈哈！刚买来时不会用，没谱东西，
                  给糊了，又用铁爆花擦得擦坏了</h2>
                <div class="imgages">
                  <div class="img">
                    <img :src="item.img">
                    <span>
                    <van-icon size="30px" name="eye-o"/>1222
                  </span>

                  </div>
                  <div class="img">
                    <img :src="item.img">
                    <span>
                    <van-icon size="30px" name="chat-o"/>50
                  </span>
                  </div>
                  <div class="img">
                    <img :src="item.img">
                    <span>
                    <van-icon size="30px" name="like-o"/>522
                  </span>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {
    name: "Community",
    data() {
      return {
        active: 1,
        list: []
      };
    },
    mounted() {
      axios({
        url: 'http://www.baidu.com/api'
      }).then(data => {
        this.list = data.data.data
      })
    }
  }
</script>

<style lang="scss" scoped>
  .guanzhu {
    height: 160px;
    border: 1px solid #BBBBBB;
    margin-top: 20px;
    padding: 15px;
    padding-right: 10px;

    .g-top {
      display: flex;

      p {
        display: flex;
        flex-direction: column;
      }
    }

    .info {
      font-size: 16px;
      margin: 20px 0;
    }

    .icon {
      display: flex;
      justify-content: space-around;

      span {
        display: flex;
      }
    }
  }

  .top {
    height: 100px;
    border: 1px solid rgba(187, 187, 187, 1);
    margin-top: 3px;

    .tucao {
      font-size: 14px;
      margin-left: 106px;
      line-height: 40px;

      span {
        font-size: 28px;
        font-style: italic;
      }
    }

    .buy {
      font-size: 28px;
      font-style: italic;
      margin-left: 35px;
    }
  }

  .huodong {
    height: 50px;
    border-bottom: 1px solid #eee;

    p {
      margin-left: 20px;
      line-height: 50px;
      font-size: 16px;
    }
  }

  .dongtai {
    padding: 15px 20px;

    .d-top {
      display: flex;
      justify-content: space-between;

      .d-top-left {
        display: flex;

        p {
          display: flex;
          flex-direction: column;
          font-size: 12px;
        }
      }

      .d-top-left {
        .van-tag {
          height: 15px;
          margin-top: 10px;
        }
      }
    }

    .d-content {
      margin-top: 10px;

      .d-title {
        font-size: 14px !important;
        color: #373737;
        margin-bottom: 10px;
      }

      .imgages {
        display: flex;
        justify-content: space-between;

        .img {
          width: 100px;
          height: 100px;

          img {
            width: 100%;
            height: 100%;
          }

          span {
            display: flex;
            justify-content: center;
            margin: 0 auto;
          }
        }
      }
    }
  }

  .biaoti {
    height: 60px;
    font-size: 16px;
    line-height: 40px;
    margin: 10px 0;
  }

  .new {
    .dongtai {
      margin-top: 10px;
    }
  }
</style>
